﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Configuration;
using System.Messaging;
using System.ServiceProcess;

namespace GtsServer.Service.WCF
{
    public class Program
    {
        static void Main(string[] args)
        {
            var queuename = ConfigurationManager.AppSettings["queuename"];
            if (!MessageQueue.Exists(queuename))
                MessageQueue.Create(queuename, true);


            //ServiceHost host = new ServiceHost(typeof(MsmqSqlService));
            //host.Open();

            //Console.WriteLine("数据库msmq服务已开启！");
            //Console.Read();


            ServiceBase[] ServicesToRun;
            ServicesToRun = new ServiceBase[]
            { 
                new SqlMsmqService()
            };
            ServiceBase.Run(ServicesToRun);
        }
    }
}
